In designing the layout of an integrated circuit of semiconductor devices, there is a case where a plurality of layout candidate data are designed for a single layer. At this time, it is desirable to select proper layout data from the plurality of layout candidate data and thereby to generate mask data.